# $Id: PKGBUILD 90154 2013-05-07 13:34:08Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: Sebastian Sareyko <public@nooms.de>

pkgname=gnustep-base
pkgver=1.24.4
pkgrel=1
pkgdesc="The GNUstep base package"
arch=('i686' 'x86_64')
url="http://www.gnustep.org/"
license=("GPL" "LGPL")
depends=(libxslt avahi gmp gcc-libs openssl libffi gnustep-make gnutls icu)
makedepends=(gcc-objc)
conflicts=('gnustep-base-svn')
groups=('gnustep-core')
options=('!emptydirs' '!makeflags')
source=(ftp://ftp.gnustep.org/pub/gnustep/core/$pkgname-$pkgver.tar.gz)
md5sums=('b300f3e6f9c27705226b741c8c018038')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  source /etc/profile.d/GNUstep.sh
  ./configure --prefix=/usr --sysconfdir=/etc/GNUstep \
	--with-ffi-include=/usr/lib/libffi-`pacman -Q libffi | cut -f2 -d\ |cut -f1 -d-`/include/
  # fix file ownership
  sed -i 's/tar -xf $(TIMEZONE_ARCHIVE);/tar -xf $(TIMEZONE_ARCHIVE);chown -R root:root * ;/' NSTimeZones/Makefile.postamble
  sed -i 's|.*gnutls_transport_set_lowat.*||' Source/GSSocketStream.m
  make VERBOSE=1
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  chown -R root.root "$pkgdir/"
}
